﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml;
using System.Collections.Generic;
public partial class Agent_ApplySupervisor :AgentPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
            BindData();
        Agent_Vip_Menu.SelectMenu = 1;
    }
    protected void BindData()
    {
        #region 绑定年度服务费用
        XmlDocument xml = new XmlDocument();
        string xmlFilePath = Server.MapPath("~/App_Data/Charge.xml");
        if (!System.IO.File.Exists(xmlFilePath))
            throw new Exception("保险监理年度服务费用配置文件不存在");
        xml.Load(xmlFilePath);
        XmlNode node = xml.SelectSingleNode("/charges/charge[@name='保险监理年度服务费']");
        //Response.Write(node == null);
        if (node == null) return;

        lCharge.Text = node.Attributes["value"].Value;

        #endregion

        #region 绑定合同附件
        pi.PageSize = int.MaxValue;
        
        pi.Where="where articleid=10";
        List<MatchIns.Model.TFuJian> ds = new MatchIns.BLL.TFuJian().GetPageList(pi).List;
        if (ds.Count > 0)
        {
            down.HRef = "/UploadFile/FuJian/"+ds[0].FileName;
        }
        #endregion

        content.InnerHtml = GetArticle(10);
    }

    protected string GetArticle(int articleID)
    {
        MatchIns.Model.TArticle model = new MatchIns.BLL.TArticle().GetModel(articleID);
        if (model == null)
            return "";
        else
            return model.Content;
    }
}
